---
# tasks file for cryptopro
- name: cryptopro package
  ansible.builtin.include_tasks:
    file: "{{ ansible_distribution_release }}.yml"

- name: cryptopro license
  ansible.builtin.shell: "/opt/cprocsp/sbin/amd64/cpconfig -license -view | grep permanent"
  register: license
  changed_when: license.failed
  failed_when: false

- name: cryptopro activation
  ansible.builtin.shell: "/opt/cprocsp/sbin/amd64/cpconfig -license -set {{ cprolicense }}"
  when: license.rc != 0
